home *** CD-ROM | disk | FTP | other *** search
- {$APPTYPE CONSOLE}
- uses DB, DBTables;
-
- var i: Integer;
- begin
- if ParamCount >= 1 then with TTable.Create(nil) do
- try
- TableName := ParamStr(1);
- Active := True;
- writeln('Type');
- writeln(' TRecord = record');
- for i:=0 to Pred(FieldDefs.Count) do
- begin
- if (FieldDefs[i].FieldClass = TStringField) then
- writeln(' ':4,FieldDefs[i].Name,': String[',FieldDefs[i].Size,'];')
- else
- begin
- if (FieldDefs[i].FieldClass = TIntegerField) or
- (FieldDefs[i].FieldClass = TWordField) or
- (FieldDefs[i].FieldClass = TSmallintField) then
- writeln(' ':4,FieldDefs[i].Name,': Integer;')
- else
- if (FieldDefs[i].FieldClass = TCurrencyField) then
- writeln(' ':4,FieldDefs[i].Name,': Double;')
- else
- writeln('{ ':6,FieldDefs[i].Name,' }')
- end
- end
- finally
- writeln(' end;');
- Free
- end
- else
- writeln('Usage: record tablename')
- end.
-